﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;

/// <summary>
/// Summary description for D_Level_Insert
/// </summary>
namespace Bestlife.ERP.DataAccess
{
    public class D_Level_Insert
    {
        public D_Level_Insert()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public static Boolean addLevels(Bestlife.ERP.Entities.E_Level_Genarator lvl)
        {
            SqlConnection conn_new = new SqlConnection();
            Boolean status =false;
            try
            {
                String connStr = ConfigurationManager.ConnectionStrings["MainConnStr"].ConnectionString;
                Bestlife.ERP.DataAccess.clsCon.connect(connStr);

                String Ssql = "INSERT INTO Distributor_Level(User_id,Parent_To_User,Level_id,Date_Create,Last_Modify)VALUES('"+lvl.User_id+"','"+lvl.Parent_to_user+"','"+lvl.Level+"','"+DateTime.Now+"','"+DateTime.Now+"')";
                Boolean exec = Bestlife.ERP.DataAccess.clsCon.AddEditDel(Ssql);
            }
            catch (Exception)
            {
                // Console.WriteLine(exx);
            }
            return status;
        }
    }
}